home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / plnk081.zip / pilot-link.0.8.1 / include / pi-datebook.h < prev    next >
C/C++ Source or Header  |  1997-08-08  |  3KB  |  81 lines

  1. #ifndef _PILOT_DATEBOOK_H_
  2. #define _PILOT_DATEBOOK_H_
  3.  
  4. #include "pi-args.h"
  5. #include "pi-appinfo.h"
  6.  
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10.  
  11. extern char * DatebookAlarmTypeNames[];
  12. extern char * DatebookRepeatTypeNames[];
  13.  
  14. enum alarmTypes {advMinutes, advHours, advDays};
  15.  
  16. enum repeatTypes {
  17.    repeatNone,
  18.    repeatDaily,
  19.    repeatWeekly,
  20.    repeatMonthlyByDay,
  21.    repeatMonthlyByDate,
  22.    repeatYearly
  23. };
  24.  
  25. /* This enumeration normally isn't of much use, as you can get just as useful
  26.    results by taking the value mod 7 to get the day of the week, and div 7
  27.    to get the week value, with week 4 (of 0) meaning the last, be it fourth
  28.    or fifth. */
  29.    
  30. enum  DayOfMonthType{
  31.        dom1stSun, dom1stMon, dom1stTue, dom1stWen, dom1stThu, dom1stFri, dom1stSat,
  32.        dom2ndSun, dom2ndMon, dom2ndTue, dom2ndWen, dom2ndThu, dom2ndFri, dom2ndSat,
  33.        dom3rdSun, dom3rdMon, dom3rdTue, dom3rdWen, dom3rdThu, dom3rdFri, dom3rdSat,
  34.        dom4thSun, dom4thMon, dom4thTue, dom4thWen, dom4thThu, dom4thFri, dom4thSat,
  35.        domLastSun, domLastMon, domLastTue, domLastWen, domLastThu, domLastFri,
  36.       domLastSat
  37. };
  38.  
  39. struct Appointment {
  40.     int event;               /* Is this a timeless event? */
  41.     struct tm begin, end;    /* When does this appointment start and end? */
  42.     
  43.     int alarm;               /* Should an alarm go off? */
  44.     int advance;             /* How far in advance should it be? */
  45.     int advanceUnits;        /* What am I measuring the advance in? */
  46.     
  47.     enum repeatTypes repeatType;  /* How should I repeat this appointment, if at all? */
  48.     int repeatForever;       /* Do the repetitions end at some date? */
  49.     struct tm repeatEnd;     /* What date do they end on? */
  50.     int repeatFrequency;     /* Should I skip an interval for each repetition? */
  51.     enum DayOfMonthType repeatDay;/* for repeatMonthlyByDay */
  52.     int repeatDays[7];       /* for repeatWeekly */
  53.     int repeatWeekstart;     /* What day did the user decide starts the week? */
  54.     
  55.     int exceptions;          /* How many repetitions are their to be ignored? */
  56.     struct tm * exception;   /* What are they? */
  57.     
  58.     char * description;      /* What is the description of this appointment? */
  59.     char * note;             /* Is there a note to go along with it? */
  60. };
  61.  
  62. struct AppointmentAppInfo {
  63.   struct CategoryAppInfo category;
  64.   int startOfWeek;
  65. };
  66.  
  67. extern void free_Appointment PI_ARGS((struct Appointment *));
  68. extern int unpack_Appointment PI_ARGS((struct Appointment *, unsigned char * record, int len));
  69. extern int pack_Appointment PI_ARGS((struct Appointment *, unsigned char * record, int len));
  70. extern int unpack_AppointmentAppInfo PI_ARGS((struct AppointmentAppInfo *, unsigned char * AppInfo, int len));
  71. extern int pack_AppointmentAppInfo PI_ARGS((struct AppointmentAppInfo *, unsigned char * AppInfo, int len));
  72.  
  73. #ifdef __cplusplus
  74. }
  75.  
  76. #include "pi-datebook.hxx"
  77.  
  78. #endif /* __cplusplus */
  79.  
  80. #endif /* _PILOT_DATEBOOK_H_ */
  81.